package org.zxp.thread.communication.join;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @program: zxp-thread-test
 * @description:
 * @author: X-Pacific zhang
 * @create: 2019-11-18 22:27
 **/
public class ThreadSequence {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> System.out.println("t1"));
        Thread t2 = new Thread(() -> {
            System.out.println("t2");
        });
        Thread t3 = new Thread(() -> {
            System.out.println("t3");
        });
        ExecutorService executorService = Executors.newSingleThreadExecutor();
        executorService.submit(() -> System.out.println("t1"));
        executorService.submit(() -> System.out.println("t2"));
        executorService.submit(() -> System.out.println("t3"));
    }
}
